package com.example.myproject.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时器
 * 1.实现定时任务
 * 2.在启动类中 需要加入 扫描改定时任务 的注解
 *      @EnableScheduling
 */
@Component
public class SchedulerTask {

    private int count=0;

    @Scheduled(cron="*/6 * * * * ?")
    private void process() {
        /*System.out.println("this is scheduler task runing  " + (count++));*/
    }
}
